<template>
  <el-menu  class="headMenu" mode="horizontal"
            text-color="#000" style="height: 60px"
            default-active="1-1"
  >
    <el-submenu index="1" style="float: right;height: 100%;
            padding: 5px 10px 5px 10px;font-family: PingFang-RE;line-height: 100% "
              class="submenu"  >
      <template slot="title" class="submenu">
        <el-avatar :size="35" v-bind:src="imgUrl"  class="icon-head" >
          <img src="../../assets/img/login/photo_80.jpg">
        </el-avatar>
        {{name}}
      </template>
      <el-menu-item index="1-1" @click="$router.push('/resetPwd')">修改密码</el-menu-item>
      <el-menu-item index="1-2" @click="clear">退出登陆</el-menu-item>
    </el-submenu>
    <el-menu-item index="3"  class="name">
      <span  style="align-content: center;margin: auto">{{indexMenu}}</span>
    </el-menu-item >
  </el-menu>
</template>

<script>
export default {
  name: "HomeHead",
  data(){
    return{
    }
  },
  methods:{
    clear(){
      this.Cookies.remove('userId')
      this.Cookies.remove('userName')
      this.Cookies.remove('userImgUrl')
      this.Cookies.remove('userType')
      this.$router.push('/login')

    }
  },

  watch:{
    deep: true
  },

  props:['name', 'imgUrl','indexMenu']


}
</script>

<style scoped>
.headMenu{
  height: 80px;
}

.icon-head{
  border-radius: 50%;
  height: 30px;
  width: 30px;
  border: 1px solid #D0021B;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 5px;
}
.submenu{
  border: none !important;
}
.name{
  padding-bottom: 40px !important;
  border-bottom: solid 2px #ff0000 !important;
  font-size: 18px;
  letter-spacing: 5px;
  color: #800321;
}


</style>
